﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECRMS.Biz.Dom;
using ECRMS.Biz;
using ECRMS.Common;
using System.ServiceModel;

namespace ECRMS.Service
{
    [ServiceContract]
    public partial interface ICtStuctureService
    {
         [OperationContract]
         CtServiceResult<List<CtStructure>> CtGetStructures(Guid ?corpId);
         [OperationContract]
         CtServiceResult<List<CtStructure>> CtInsertStructure(CtStructure structure);
         [OperationContract]
         CtServiceResult<List<CtStructure>> CtUpdateStructure(CtStructure structure);
    }

    public partial class ECRService : ICtStuctureService
    {

        CtServiceResult<List<CtStructure>> ICtStuctureService.CtGetStructures(Guid? corpId)
        {
            var logic = new CtStructureLogic();
            return logic.GetStructuresByCorpId(corpId);
        }

        CtServiceResult<List<CtStructure>> ICtStuctureService.CtInsertStructure(CtStructure structure)
        {
            var logic = new CtStructureLogic();
            return logic.Insert(structure);
        }

        CtServiceResult<List<CtStructure>> ICtStuctureService.CtUpdateStructure(CtStructure structure)
        {
            var logic = new CtStructureLogic();
            return logic.Update(structure);
        }
    }
}
